package cn.itsource.constants;


import java.util.Arrays;
import java.util.List;

//常量维护
public class Constants {

    public static final String CURRENT_LOGIN_KEY="currentUser";

    //手机号正则表达式
    public static final String CHINA_PHONE_REGEX =  "^((13[0-9])|(14[0,1,4-9])|(15[0-3,5-9])|(16[2,5,6,7])|(17[0-8])|(18[0-9])|(19[0-3,5-9]))\\d{8}$";

    //编码
    public static final String UTF_8 = "UTF-8";

    //redisson锁
    public static final String DRIVER_GRAB_ORDER_LOCK = "DRIVER_GRAB_ORDER_LOCK";

    //司机服务
    public class Driver {

        public static final int TYPE_DRIVER = 0;
        public static final int TYPE_CUSTOMER = 1;
    }
    //远程调用
    public class Remote {
        //服务名
        public static final String SERVICE_UAA = "it-fccar-service-uaa";

        public static final String PREFIX_LOGIN_REMOTE = "/login/remote";
    }

    //订单状态
    public class orderStatus{
        //0等待接单，1已接单，2司机已到达，3开始代驾，4结束代驾，
        //5.司机确认费用，6未付款，7已付款，8订单已结束，9顾客撤单，
        //10司机撤单，11事故关闭，12其他
        public static final int ORDER_STATUS_WAIT = 0;
        public static final int ORDER_STATUS_ACCEPTED = 1;		//对应工作状态的 ：接客户
        public static final int ORDER_STATUS_ARRIVE = 2;		//对应工作状态的：到达代驾点
        public static final int ORDER_STATUS_START_DRIVING = 3;	//对应工作状态的：开始代驾
        public static final int ORDER_STATUS_COMPLETE_DRIVED = 4;	//结束代驾-应该跳转 确认费用页
        public static final int ORDER_STATUS_ENSURE = 5;	//司机已经确认费用 应该跳转 发送账单页
        public static final int ORDER_STATUS_NOT_PAY = 6;	//账单已经发送 跳转订单详情页
        public static final int ORDER_STATUS_PAYED = 7;
        public static final int ORDER_STATUS_FINISH_ORDER = 8;
        public static final int ORDER_STATUS_CUSTOMER_CANCEL_ORDER = 9;
        public static final int ORDER_STATUS_DRIVER_CANCEL_ORDER = 10;
        public static final int ORDER_STATUS_ACCIDENT_CLOSE = 11;
        public static final int ORDER_STATUS_OTHER = 12;

        //用户手动取消订单
        public static List<Integer> getCancelHandValue(){
            return Arrays.asList(ORDER_STATUS_WAIT,ORDER_STATUS_ACCEPTED,
                    ORDER_STATUS_ARRIVE,ORDER_STATUS_START_DRIVING);
        }

        public static List<Integer> getRunOrderStatus(){
            return Arrays.asList(ORDER_STATUS_WAIT,ORDER_STATUS_ACCEPTED,ORDER_STATUS_ARRIVE,
                    ORDER_STATUS_START_DRIVING,ORDER_STATUS_NOT_PAY);
        }

        public static List<Integer> checkRunningOrderStatus(){
            return Arrays.asList(ORDER_STATUS_ACCEPTED,ORDER_STATUS_ARRIVE,
                    ORDER_STATUS_START_DRIVING);
        }
    }

}
